package com.walle.eve.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.walle.eve.datasource.RoutingDataSource;
import com.walle.eve.datasource.RoutingStrategy;

@Mapper
public interface RolesMapper {

	@RoutingDataSource(RoutingStrategy.DB2)
	@Select("select * from user_roles")
	List<Map<String, Object>> getRoleList();
	
	@RoutingDataSource(RoutingStrategy.DB2)
	@Insert("insert into user_roles (username,role_name) values (#{userName},#{roleName})")
	int addRole(@Param(value = "userName") String userName, @Param(value = "roleName") String roleName);
}
